package com.kgdev.cweb.entities.prod.owned.client;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import com.kgdev.cweb.entities.prod.managed.Client;
import com.kgdev.cweb.entities.pub.ClientRole;

/**
 * The persistent class for the identification database table.
 * 
 */
@Entity
@Table(name = "prod_client_idnf")
public class ClientIdentification implements Serializable {
	private static final long serialVersionUID = 1L;

	@Column(name = "password_hash", length = 50)
	private String passwordHash;

	@ManyToOne(optional=false)
	@JoinColumn(name = "role", nullable=false)
	private ClientRole role;

	public ClientRole getRole() {
		return role;
	}

	public void setRole(ClientRole role) {
		this.role = role;
	}

	@Id
	@Column(name = "client_id")
	private String clientId;

	public String getClientId() {
		return clientId;
	}

	public void setClientId(String clientId) {
		this.clientId = clientId;
	}

	@OneToOne(mappedBy = "identification")
	@JoinColumn(name = "client_id")
	private Client client;

	public ClientIdentification() {
	}

	public Client getClient() {
		return this.client;
	}

	public String getPasswordHash() {
		return this.passwordHash;
	}

	public void setClient(Client client) {
		this.client = client;
	}

	public void setPasswordHash(String passwordHash) {
		this.passwordHash = passwordHash;
	}

}